home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3057 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *Pointer to Functions();   /* HELP */
  5. Date: 25 Jan 1996 19:35:41 GMT
  6. Organization: OpenVision
  7. Message-ID: <4e8m2d$c4q@spanky.pls.ov.com>
  8. References: <4dvrq8$c2c@news.unicomp.net>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article c2c@news.unicomp.net, jgore@conline.com (Jerry_Gore) writes:
  13. >How do I pass a pointer to a funtion?
  14. >The following is found in a program:
  15. >
  16. >    #define WORD    unsigned int       
  17. >    void    InstallTimer0(WORD period,void far (*func)(void));
  18. >
  19. >My function is thus:
  20. >
  21. >    void far animate(void)    /* I added 'far' for no good reason.   */
  22. >    {                         /* It uses that name in InstallTimer0. */ 
  23. >    /* do what ever */        
  24. >    return;
  25. >    }
  26. >
  27. >How do I send InstallTimer0 the pointer to my function animate ???
  28. >I tried:
  29. >
  30. >     InstallTimer0(120 , (*animate)());
  31. >
  32. >But of course, this does not work and neither did anything else!
  33. >What do I do ???
  34. >
  35.  
  36.  
  37. Have you tried?:
  38.  
  39.      InstallTimer0(120, animate);
  40.  
  41.             Fletcher.Glenn@ov.com
  42.  
  43.  
  44.